<?php

namespace module\manage\validate\auth;

use app\Validate;

/*
 * 管理员模型.
 *
 * @property integer $id
 */
class Admin extends Validate
{
    /**
     * 验证场景需要的字段.
     *
     * @var array<array>
     */
    protected $scene = [
        'save' => ['role_id', 'name', 'memo']
    ];
    /*
     * @inheritdoc
     */
    public $rule = [
        'id' => 'require|integer|max:10',
        'role_id' => 'requireWithout:id|integer', 
        'name' => 'requireWithout:id|string',
        'memo' => 'string|max:40'
    ];
    /*
     * @inheritdoc
     */
    public $filed = [
        'id' => 'ID',
        'role_id' => '角色', 
        'name' => '姓名',
        'memo' => '备注'
    ];
}
